home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7236 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mudskipper.cac.psu.edu!user
  2. From: fcusack@tdx.org (frank.)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: (VOID *) Problems
  5. Date: Thu, 15 Feb 1996 14:43:02 -0400
  6. Organization: Psychic Enemies Network
  7. Distribution: world
  8. Message-ID: <fcusack-1502961443020001@mudskipper.cac.psu.edu>
  9. References: <3120F9B8.167E@pangea.stanford.edu> <fcusack-1302961720420001@mudskipper.cac.psu.edu> <4ft16a$1v1@sparcserver.lrz-muenchen.de>
  10. NNTP-Posting-Host: mudskipper.cac.psu.edu
  11.  
  12. In article <4ft16a$1v1@sparcserver.lrz-muenchen.de>,
  13. ua302aa@lrz-muenchen.de () wrote:
  14.  
  15. > fcusack@tdx.org (frank.) writes:
  16. > >In article <3120F9B8.167E@pangea.stanford.edu>, BITtencourt
  17. > ><bit@pangea.stanford.edu> wrote:
  18. > >>   double x,z;
  19. > >    ^^^^^^^^^^
  20. > >z is declared as type double.
  21. > >> 
  22. > >>   x = 78.;
  23. > >>   printf("x = %f \n",x);
  24. > >>   p = (void *) &x;
  25. > >>   printf("*p = %f \n",(double *) p);
  26. > >>   z = (double *)p;                   /*  problems. I also tried other
  27. > >>                                          cast forms.  */
  28. > >        ^^^^^^^^^^^
  29. > >here you try to assign a double * to z, which does not match z's type.
  30. > >Try z = &p; /* or z = &(double *) p; /* but the cast is not really needed */
  31. > If z is a pointer to double, a pointer to a pointer to double won't 
  32. > match it's type more closely than a pointer to double, will it?
  33. >
  34.  
  35. quite right. I used "&" instead of "*". Ugh. Lots of ppl caught my error
  36. though, it seems, based on the email I received. :)
  37. ~Frank
  38.  -- I am Pentium of Borg.  Division is futile.  You will be approximated. --
  39.  --   If you build it, they will come --> http://www.tdx.org/~fcusack/    --
  40.  -- PGP key fingerprint: 01 C0 C0 B9 CC 78 67 0F  3F 64 80 65 8B 0F F9 EA --
  41.